home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 927 b | 38 lines | [TEXT/GEOL] |
- Item 2135956 4-Dec-90 16:54PST
-
- From: X2228 Lowell Schneider Cns,LSchneider,ACR
-
- To: MACAPP.TECH$ MacApp Technical
-
- Sub: C++ oddity
-
- I wrote the following lines of code in C++. The routine draw_fkey() conforms
- to that which is required by the Each() method of TList.
-
- If you look in routine draw_fkey(), you see that parameter 'arg' is cast into
- TDBKey! Not 'item' as is proper. Parameter 'arg' should be NULL.
-
- I found this "solution" after hours of frustrating debugging. Any clues?
- Hints? I HAVE been able to use Each() in other situations successfully, so I
- am really baffled.
-
- Thanks, Lowell
- LSC
-
-
- class TDBTable : public TDBObject {
- ...
- TList *fkey;
- }
-
- pascal void draw_fkey (TObject *item, void *arg)
- {
- ((TDBKey*)arg) -> draw ();
- }
-
- void TDBTable::draw_fkeys (void)
- {
- fkey->Each (draw_fkey, NULL);
- }
-
-